﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class RotationParform : MonoBehaviour {

    public bool clockwise;

    public float duration = 1f;
    public float delay = 5f;

    private void Start() {

        OnComplete();

    }

    void OnComplete() {
        transform.DOKill();
        transform.DOLocalRotateQuaternion(Quaternion.Euler(0, 0, clockwise ? -180f : 180f) * transform.localRotation, duration)
                 .SetDelay(delay)
                 .OnComplete(OnComplete)
                 .PlayForward();
    }

}
